package com.groupbuying.orderproducer.mq;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 订单消息MQ配置文件
 * @Author Vincentxin
 * @Date 2019-05-10
 */
@Component
public class OrderMQConfig {

    public static  String TOPIC ;
    public static  String GROUP_ID;
    public static final String ACCESS_KEY = "LTAIkLoCSLqX7QFG";
    public static final String SECRET_KEY = "anr8xwxEFrN4Rq0Gjw5MXxELuDb12V";
    public static final String NAMESRV_ADDR = "http://onsaddr.mq-internet-access.mq-internet.aliyuncs.com:80";

    //注入对应中心的topic
    @Value("${RocketMQ_Key.Order.Topic}")
    private void setTOPIC(String TOPIC) {
        OrderMQConfig.TOPIC = TOPIC;
    }
    //注入对应中心的groupId
    @Value("${RocketMQ_Key.Order.GroupId}")
    private void setGroupId(String groupId) {
        OrderMQConfig.GROUP_ID = groupId;
    }

//---------------Tag——————————————
    //交易状态前缀
    public static final String DEAL_TAG_PREFIX = "DEAL_";
    //订单状态前缀
    public static final String ORDER_TAG_PREFIX = "ORDER_";
    //商品订单状态前缀
    public static final String COMMODITY_TAG_PREFIX = "COMMODITY_";

    //订单定时关闭专用Tag
    public static final String DEAL_TAG_TIMINGCLOSE = DEAL_TAG_PREFIX+"TIMING";

    //交易状态：关闭
    public static final String DEAL_TAG_CLOSE = DEAL_TAG_PREFIX+"CLOSE";
    //交易状态：冻结
    public static final String DEAL_TAG_FREEZE = DEAL_TAG_PREFIX+"FREEZE";

    //订单状态：已支付
    public static final String ORDER_TAG_PAY = ORDER_TAG_PREFIX+"PAY";
    //订单状态：退款中
    public static final String ORDER_TAG_REFUNDING = ORDER_TAG_PREFIX+"REFUNDING";
    //订单状态：退款成功
    public static final String ORDER_TAG_REFUNDED = ORDER_TAG_PREFIX+"REFUNDED";
    //订单状态：退款失败
    public static final String ORDER_TAG_REFUNDFAIL = ORDER_TAG_PREFIX+"REFUNDFAIL";

    //商品订单定时关闭专用Tag
    public static final String COMMODITY_TAG_TIMINGCLOSE = COMMODITY_TAG_PREFIX + "TIMING";

    //消费者订阅全部tag
    public static final String ALL_TAG = "*";




}
